import urllib
from xml.dom import minidom

def getText(nodelist):
    rc = []
    for node in nodelist:
        if not node.data.isspace():
            rc.append(node.data)
    return ''.join(rc)

class ParserXML():
    def __init__(self, page='http://www.leonardomiranda.com.br/xml_users'):
        self.url = page
        self.xmlString = self.parseUrl()
        self.domDocumento = self.getDomDocumento()
        self.nomeUsuario = self.getNomeUsuario()
        
    def parseUrl(self):
        try:
            s = urllib.urlopen(url).read()
        except:
            s = file('sample.xml').read()
        return s

    def getDomDocumento(self):
        res = []
        elementList = self.domBoletim.getElementsByTagName('documento')
        if elementList:
            domCondicoes = elementList[0]
            for i in domCondicoes.getElementsByTagName('*'):
                res.append(Condicao(i))
        return res








    def parseCondicoes(self):
        res = []
        elementList = self.domBoletim.getElementsByTagName('member')
        if elementList:
            domCondicoes = elementList[0]
            for i in domCondicoes.getElementsByTagName('*'):
                res.append(Condicao(i))

        return res


    def getNomeUsuario(self):
        
        
class Membos():